package Array;

import java.util.Scanner;

public class BankTicket {
    private String name;
    Queue queue = new Queue();

    private void getTicket() {
        if (queue.isEmpty()) {
            for (int i = 0; i < 100; i++) {
                queue.push(i);
            }
        }
        System.out.println("您好！" + name + ",您的号码是：" + queue.pop());
    }

    private void InputName() {
        System.out.println("请输入您的名字");
        Scanner scanner = new Scanner(System.in);
        name = scanner.next();
        this.getTicket();

    }

    public void start() {
        while (true) {
            this.InputName();
        }
    }
}
